<div class="page-title clearfix">
  <div class="title">矿石记录</div>
</div>

<div class="panel panel-body">
  <!--搜索 start-->
  <form nz-form (submit)="queryOreRecordList(1)">
    <div class="search-group">
      <span class="search-title">账号：</span>
      <div class="search-main">
        <input nz-input name="account"
               [(ngModel)]="searchParams.account"
               placeholder="请输入用户账号">
      </div>
    </div>
    <div class="search-group">
      <span class="search-title" style="width: 120px;">状态：</span>
      <div class="search-main">
        <nz-radio-group name="isActive" [(ngModel)]="searchParams.state" [nzButtonStyle]="'solid'">
          <label nz-radio-button *ngFor="let option of oreStates" [nzValue]="option.key">{{option.val}}</label>
        </nz-radio-group>
      </div>
    </div>
    <div class="inline-block">
      <button nz-button class="ml-20 mr" [nzType]="'primary'" title="搜索" type="submit">
        <i class="anticon anticon-search"></i><span>搜索</span>
      </button>
      <button nz-button class="mr" title="重置" type="reset" (click)="resetSearch()">
        <i class="anticon anticon-sync"></i><span>重置</span>
      </button>
    </div>
  </form>
  <!--搜索 end-->
</div>

<div class="panel">
  <nz-table #nzTable
            [nzData]="oreRecordList.voList"
            [nzLoading]="_loading"
            [nzFrontPagination]="false"
            [nzShowTotal]="totalRow"
            [nzPageSize]="oreRecordList.pageSize"
            [nzTotal]="oreRecordList.totalRow"
            [nzPageIndex]="oreRecordList.curPage"
            (nzPageIndexChange)="queryOreRecordList($event)">
    <thead nz-thead>
    <ng-template #totalRow>共 {{oreRecordList.totalRow}} 条数据</ng-template>
    <tr>
      <th nz-th class="text-center" nzWidth="5%"><span>序号</span></th><!--序号-->
      <th nz-th class="text-center" nzWidth="20%"><span>账户</span></th><!--账户信息-->
      <th nz-th class="text-center" nzWidth="20%"><span>矿石总量</span></th><!--矿石总量-->
      <th nz-th class="text-center" nzWidth="20%"><span>动态收益总量</span></th><!--动态收益总量-->
      <th nz-th class="text-center" nzWidth="20%"><span>待提炼总数量</span></th><!--待提炼总数量-->
      <th nz-th class="text-center" nzWidth="15%"><span>状态</span></th><!--状态:激活 Active，停止 Stop-->
    </tr>
    </thead>
    <tbody nz-tbody>
    <ng-template ngFor let-data [ngForOf]="nzTable.data" let-i="index">
      <tr nz-tbody-tr>
        <td nz-td class="text-center">{{i+1}}</td>
        <td nz-td class="text-center">{{data.account}}</td>
        <td nz-td class="text-center">{{(data.ore || 0) | number:'1.2-2'}}</td>
        <td nz-td class="text-center">{{(data.layerTotalOre || 0) | number:'1.2-2'}}</td>
        <td nz-td class="text-center">{{(data.refineTotalOre || 0) | number:'1.2-2'}}</td>
        <td nz-td class="text-center font12">
          <nz-badge nzStatus="success" *ngIf="data.state === oreAccountState.active"></nz-badge>
          <nz-badge nzStatus="default" *ngIf="data.state === oreAccountState.stop"></nz-badge>
          {{data.state | enumName:states}}
        </td>
      </tr>
    </ng-template>
    </tbody>
  </nz-table>
</div>
